Thread: main() ; argv[1] = string at argv[0]???

  1. #1
    Registered User
    Join Date
    Mar 2008
    Posts
    12

    main() ; argv[1] = string at argv[0]???

    I have been reading thru the FAQ and looking at snippets and source code, but am somewhat confused how main() works. It seems that in several places that this function somehow contains the name of a text file(argv[0]) and the file as a string in argv[1]. Is this only the case when a text file is sent to the function which has only 2 argument parameters (argc) whose values are argv[0] and argv[1]. ......hmmm,, I maybe answering my own questions, but if you could clarify further I would appreciate. Thanks ahead of time. UC

  2. #2
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C++ ini file reader problems
    By guitarist809 in forum C++ Programming
    Replies: 7
    Last Post: 09-04-2008, 06:02 AM
  2. Inheritance Hierarchy for a Package class
    By twickre in forum C++ Programming
    Replies: 7
    Last Post: 12-08-2007, 04:13 PM
  3. RicBot
    By John_ in forum C++ Programming
    Replies: 8
    Last Post: 06-13-2006, 06:52 PM
  4. Compile Error that i dont understand
    By bobthebullet990 in forum C++ Programming
    Replies: 5
    Last Post: 05-05-2006, 09:19 AM
  5. problems with overloaded '+' again
    By Brain Cell in forum C++ Programming
    Replies: 9
    Last Post: 04-14-2005, 05:13 PM